home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr11 / powerb5.zip / P5WPR009.TIP < prev    next >
Text File  |  1993-06-01  |  3KB  |  98 lines

  1. When I create a document in Word for Windows, I often need
  2. to use dashes, the copyright symbol, the registered
  3. trademark symbol, and other characters that are available
  4. only via combinations of the <Alt> key and digits on the
  5. Insert·Symbol menu. Rather than trying to commit every
  6. sequence of keystrokes to memory or select what I need from
  7. a table with 256 options, I wrote a macro that gives me easy
  8. access to the symbols that I use most. The macro creates a
  9. dialog box with buttons for the special characters and
  10. assigns each a shortcut key for fast access. It then uses
  11. WordBasic's Insert statement to send the character.
  12.  
  13. Vijay Ramachandran
  14. Armonk, New York
  15.  
  16. Editor's Note: To create this macro, start Word for Windows
  17. and use the Insert·File... command to import the text of the
  18. macro from the file P5WPR\SPECCHAR.TXT (found on your
  19. PowerBase *.* Volume 5 diskette) into a new Word for Windows
  20. document. Then copy the body of the macro to the clipboard,
  21. omitting the Sub Main statement at the top and the End Sub
  22. statement at the bottom. Next, select Tools·Macros, type
  23. InsertSpecial as your macro name, and select Edit. Paste the
  24. macro text between the Sub and End Sub statements in the
  25. macro editing window. Finally, double click on the "go away"
  26. box in the upper left corner of the editing window and tell
  27. Word for Windows that you want to save the macro.
  28.  
  29. This macro is pointless unless you can get to it easily from
  30. the keyboard, so assign it a key for fast access. Select
  31. Tools·Options and press K to get to the Keyboard Options
  32. dialog box; from here assigning the macro to the key of your
  33. choice is pretty much self-explanatory.I made one slight
  34. improvement to this macro: turning the original OptionButton
  35. commands to PushButtons. With this change, once the box is
  36. up, PushButtons allow you to insert your selection with one
  37. keystroke, whereas OptionButtons require two (the hot key
  38. and <Enter>).
  39.  
  40. The text of the macro is shown below.
  41.  
  42. ---- BEGIN LISTING ----
  43. Sub Main
  44. Begin Dialog UserDialog 325, 290
  45.   Text 10, 6, 144, 12, "Special Characters"
  46.   PushButton 10, 24, 210, 21,   "E&m Dash"
  47.   PushButton 10, 47, 210, 21,   "E&n Dash"
  48.   PushButton 10, 70, 210, 21,   "&Open Double Quote"
  49.   PushButton 10, 94, 210, 21,   "&Close Double Quote"
  50.   PushButton 10, 118, 210, 21, "Open &Single Quote"
  51.   PushButton 10, 142, 210, 21, "&Apostrophe"
  52.   PushButton 10, 166, 210, 21, "Co&pyright"
  53.   PushButton 10, 190, 210, 21, "&Registered Trademark"
  54.   PushButton 10, 214, 210, 21, "One &Fourth"
  55.   PushButton 10, 238, 210, 21, "One &Half"
  56.   PushButton 10, 262, 210, 21, "Three &Quarters"
  57.   CancelButton 230, 3, 88, 21
  58. End Dialog
  59. Dim Characters As UserDialog
  60. On Error Goto Goodbye
  61. ChoiceMade = Dialog(Characters)
  62. Select Case ChoiceMade
  63.    Case 1
  64.     Insert Chr$(150)
  65.    Case 2
  66.     Insert Chr$(151)
  67.    Case 3
  68.     Insert Chr$(147)
  69.    Case 4
  70.     Insert Chr$(148)
  71.    Case 5
  72.     Insert Chr$(145)
  73.    Case 6
  74.     Insert Chr$(146)
  75.   Case 7
  76.     Insert Chr$(169)
  77.   Case 8
  78.     Insert Chr$(174)
  79.   Case 9
  80.     Insert Chr$(188)
  81.   Case 10
  82.     Insert Chr$(189)
  83.   Case 11
  84.     Insert Chr$(190)
  85.   Case Else
  86.   End Select
  87. GoodBye:
  88. End Sub
  89. ---- END LISTING ----
  90.  
  91.  
  92. Title: Wielding Wild Characters
  93. Category: WPR
  94. Issue Date: December, 1992
  95. Editor: Brett Glass
  96. Supplementary Files: P5WPR\SPECCHAR.TXT
  97. Filename: P5WPR009.TIP
  98.